#ifndef _ODN_ANIMATED_SKELETON_H
#define _ODN_ANIMATED_SKELETON_H

//Engine headers 
#include "odn_Timing.h"
#include "odn_util_Vector3D.h"
#include "odn_scene_Skeleton.h"

//Standard library headers 
#include <vector>

using ouden::utility::Vector3D;
/*
namespace ouden
{
	namespace scene
	{

		class ODN_AnimatedSkeleton : ODN_Skeleton
		{
			
		private:

			class ODN_KeyFrame
			{
				
			public:
				
				//Duration of keyframe 
				long time;
				
				//Array of point positions for frame 
				std::vector<Vector3D> points;
				
				//Skeleton data making up this keyframe 
				//ODN_Skeleton skeleton;
				
			};
			
			class ODN_Animation
			{
				
			public:
				
				//Constructors and destructor 
				ODN_Animation() : blend(1), curframe(0), nextframe(1), framecount(1), lasttime(getTimer()->getTime()) 		{} 
				ODN_Animation(char* Filename) : blend(1), curframe(0), nextframe(1), framecount(1), lasttime(getTimer()->getTime()) 		{ loadAnimation(Filename); } 
				~ODN_Animation()		{}
				
				//Called by parent AnimatedSkeleton object to update the animation 
				bool Update();
				
				//Returns the animated position of a specified point 
				//TODO: Check if should return ODN_Point 
				Vector3D getCurrentPointPos(int PointIndex);
				
				//Loads an animation from a file 
				bool loadAnimation(char* Filename);
				
				//Variable access functions 
				void setBlend(float Value)		{ blend = Value; }
				float getBlend()				{ return blend; }
				
			private:
				
				//How much the animation is applied 
				float 	blend;
				
				//Index of the current frame 
				int 	curframe;
				
				//Index of the next frame 
				int 	nextframe;
				
				//Number of frames in the animation 
				int 	framecount;
				
				//Time of the last keyframe 
				long 	lasttime;
				
				//Array of keyframes 
				std::vector<ODN_KeyFrame> 	keyframes;
				
			};
			
		
		
		public:
			
			//COnstructor and destructor 
			ODN_AnimatedSkeleton(ODN_Scene* Scene) : ODN_Skeleton(Scene)		{}
			~ODN_AnimatedSkeleton()		{}
			
			//TODO: Work out where the skeleton update function will be called 
			virtual bool Update()
			{
				
				//Loop through the animations 
				for (int a=0;a<animations.size();a++) {
					
					//Check that the animation will actually be used 
					if (animations[a].getBlend() > 0)
						//Update the animation 
						animations[a].Update();
					
				}
				
				//Temporary position variable to hold sum of positions from animations 
				Vector3D tmpPoint;
				
				//Loop through points 
				for (int p=0;p<points.size();p++) {
					
					//Loop through animations
					for (int a=0;a<animations.size();a++) {
						
						//Check that the animation will actually be used 
						if (animations[a].getBlend() > 0) 
							//Add the effect of this animation on this point to the temporary position variable 
							tmpPoint += animations[a].getCurrentPointPos(p) * animations[a].getBlend();
													
					}
					
					//Set the new position of this point to the temporary position variable 
					points[p]->pos = tmpPoint;
					
					//Reset the temporary position variable 
					tmpPoint = Vector3D(0, 0, 0);
					
				}
				
			}
			
			//TODO: Think about how to store all animations in one place and then just look them up for each different object 
			void addAnimation(char* Filename)
			{
				
				
				
			}
			
		private:
			
			//Array of different animations 
			std::vector<ODN_Animation> animations; 
			
		};
		
	} //namespace scene 
} //namespace ouden 
*/
#endif //_ODN_ANIMATED_SKELETON_H 
